A method for identifying the keys pressed in a non-coded matrix keyboard, known as line inversion, is known. This method uses a universal parallel input-output interface, in which, as shown in FIG. 6, an eight-bit port is assigned to interfacing of the keyboard by individual input or output programming of the lines of the port. The identification of the keys proceeds in two steps.
In the first step, A, four lines of the universal port, connected to the rows, are output programmed. The four columns are input programmed. The value "0000" is then sent as an output to the port. The result is the input value of "1011". Each time, the true polarities are used, and the 0 corresponds to the position of the column at which a key has been depressed, thus connecting the corresponding column to ground.
In the second step, B, the inputs and outputs are inverted. This inversion can easily be performed by a parallel interface circuit by changing the bits of the data direction register. The initial value of the data direction register was "00001111", and it becomes "11110000". This operation can be done by way of a single instruction requiring supplementation of the contents of the data direction register. The data register itself undergoes no modification whatsoever.
Next, the final value of the contents of the data register is read, as can be seen from FIG. 6; the input at the columns becomes "1011". The value "0" corresponds to the column for which a key has been depressed. The complete value of the data register is "1011 1011"; each 0 indicates a closure of a contact making it possible to identify both the row and the column at once. The microprocessor uses this eight-bit code as a vector for connection with a table memorized in a ROM, which contains the eight-bit code corresponding to the key of the keyboard.
The method described above has the disadvantage of allowing a defrauder who seeks to intervene between the wires joining the keyboard in the interface to identify the depressed key easily. This is all the more problematic when measures have already been taken to protect the information contained in the terminal or device to which the keyboard is connected.